// iscroll 插件初始化

var myScroll = new IScroll('#wrapper', {
    mouseWheel: true,
    scrollX: true,
    click: true
});

$.ajax({
    type: "get",
    url: "http://193.112.55.79:9090/api/getbaicaijiatitle",
    // data: "data",
    dataType: "json",
    success: function (res) {
        console.log(res);
        var html = template('cp_navTemp', res)
        // console.log(html);
        $('.nav_t').html(html)
        var titleId = res.result[0].titleId
        console.log(titleId);



        $('.nav_t')[0].addEventListener('touchstart', function (event) {
            titleId = $(event.target.parentNode).data('titleid')
            shuju();
            console.log(123);

        })



        function shuju() {
            $.ajax({
                type: "get",
                url: "http://193.112.55.79:9090/api/getbaicaijiaproduct",
                data: { titleid: titleId },
                dataType: "json",
                success: function (res) {
                    console.log(res);
                    var html = template('bc_centerTemp', res)
                    // console.log(html);
                    $('.bc_center').html(html)

                }
            });
        }
        shuju()
    }

});







